//
//  WBNetworkManager+Extension.swift
//  WeiBo
//
//  Created by gzy on 2018/1/22.
//  Copyright © 2018年 GZY. All rights reserved.
//

import Foundation
// MARK: 封装新浪微博的请求
extension WBNetworkManager {
    

    /// 加载新浪微博字典数据
    ///
    /// - Parameter completion: 完成回调list:
    func statusList(completion: @escaping (_ list: [[String: AnyObject]]?,_ isSuccess: Bool) ->()) {
        let urlString = "https://api.weibo.com/2/statuses/home_timeline.json"
        let parmes = ["access_token":"2.00IXLaFGXyntdD15205816abiNOuQB"]
        request(URLString: urlString, parameters: parmes as [String : AnyObject]) { (json, isSuccess) in
            let result = (json as! NSDictionary)["statuses"] as? [[String: AnyObject]]
            completion(result, isSuccess)
        }
    }
        
}
